package com.sx.art2.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sx.art2.beans.User;
import com.sx.art2.mapper.UserMapper;
import com.sx.art2.service.UserService;


@Service
public class UserServiceimpl implements UserService {

	@Autowired
	UserMapper userMapper;
	@Override
	public void add(User user) {
		userMapper.add(user);
		
	}
	@Override
	public void delete(int id) {
		userMapper.delete(id);
	}
	@Override
	public User selectById(int id) {
		return userMapper.selectByID(id);
	}
	@Override
	public void update(User user) {
		userMapper.update(user);
		System.out.println("service:"+user.getUserName());
		
	}
	@Override
	public User selectByPhone(String userPhone) {
		// TODO Auto-generated method stub
		return userMapper.selectByPhone(userPhone);
	}
	@Override
	public void updatePassword(User user) {
		// TODO Auto-generated method stub
		userMapper.updatePassword(user);
	}
	@Override
	public List<User> list() {
		// TODO Auto-generated method stub
		return userMapper.list();
	}
	@Override
	public List<User> listOne(int userId) {
		// TODO Auto-generated method stub
		return userMapper.listOne(userId);
	}
	@Override
	public void deleteAll(int[] userIds) {
		// TODO Auto-generated method stub
		userMapper.deleteAll(userIds);
	}
	@Override
	public List<User> Ulist() {
		// TODO Auto-generated method stub
		return userMapper.Ulist();
	}

}
